﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Inmast
/// </summary>
public class Inmast
{
	public Inmast()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public Inmast(string _itemkey,string _desc,double _price,int _quantity)
    {
        this.itemkey = _itemkey;
        this.desc = _desc;
        this.price = _price;
        this.quantity = _quantity;
    }
    private string itemkey;

    public string Itemkey
    {
        get { return itemkey; }
        set { itemkey = value; }
    }
    private string desc;

    public string Desc
    {
        get { return desc; }
        set { desc = value; }
    }
    private double price;

    public double Price
    {
        get { return price; }
        set { price = value; }
    }
    private int quantity;

    public int Quantity
    {
        get { return quantity; }
        set 
        {
            if (quantity < 0)
            {
                throw new ArgumentException("Số lượng nhập vào phải lớn hơn 0");
            }
            else
            {
                quantity = value;
            }
        }
    }
    private double ThanhTien;

    public double ThanhTien1
    {
        get
        {
            return quantity * price; 
        }
       
    }
}